package cn.bjit.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

public class AlipayConfig {

    /**
     * 支付宝网关地址  TODO
     */
    public static final  String PAY_GATEWAY="https://openapi.alipaydev.com/gateway.do";


    /**
     * 支付宝 APPID TODO
     */
    public static final  String APPID="2021000121619844";

    /**
     * 应用私钥 TODO
     */
    public static final String APP_PRI_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOAkGG5N01F7KAajUrGJmwsiftl3Ibx3qlMUwWoEM9iVRuxgwPs0gItEHgsQFj5OsbJeYAdA4ZSK7ANIDAux46MHhIrKrrf5tP/bYVT+HDgNolXqmhzG9jEpnvykYWNav89Gg9ph+4w+QJd0sJKzX+MUrrKqf/TPJtmYUpEAODhi8fWCZV4Y0xoS3o/YPSyb6QcDEcDwcO5wkjjh85S73lNmPLIH0LIfgNYIPs388OaPD50K7rIWonYvlItNTgfi4WuDYquzRX77rQP3Kh7IVpaUJrunGGlcZ4K2waPRHQWNRt75ujnfs8wv9ZcdtkXcvxGRNrU9V4sNqXydTxHlAxAgMBAAECggEAAnzPoQlJRrDPk6hIniSkLJAyWtsYSJxJ7bLbXloYU2+gZwBZHb1KObzOmpz/JTzRUXxsdv2RcafwR7Wju7yLXwGSWdOMeuuVUOVk1yK7Fa2gJJ9v4UGvgdDFmYm1iJYQGTI+0TWjwJzN1cydJ9/15in+4fexUauLY5gY2QtKxHcCld4eTdd6CT92rZ96WOnrAhIo9EpaZME+X2NTcBByW2uRZ+wpwDBT5UUQ+IgHel89qMIBqeVy/3+lmKCszvfPkuM5Nv9wX7ZMWRX4rVN6WUsXUmZIvClNoLmghgUhjqDNuE9lil9C+mUDNS7RO7BCoz+lNOACLOIy0Yc9ZJn0QQKBgQDCwHODfzZt4DhcE69qQPlFbGgxEKetjAIZcIp9wl6Dy/u7vL4ixTeHAaxq+KGSjGjaYln6r+bl8wz+E7ZRqPKzwvO5np1lTbGA9v63gDX6IzvHVVQ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BSSLQd6peHZx+SuJLTippuioq4CcWRMZ6cAPpc+vlRhlZL0EB8WurQ2quw+ehAJbJaxn5PNkdtd2rIPnEsdbu8Sr6lB2ikMlt7EQYaBIWLgLGc5TH4GDiDI0KucoXQIDAQAB";
    /**
     * 签名类型
     */
    public static final  String SIGN_TYPE="RSA2";


    /**
     * 字符编码
     */
    public static final  String CHARSET="UTF-8";


    /**
     * 返回参数格式
     */
    public static final  String FORMAT="json";


    /**
     * 构造函数私有化
     */
    private AlipayConfig(){

    }


    private volatile static AlipayClient instance = null;


    /**
     * 单例模式获取, 双重锁校验
     * @return
     */
    public static AlipayClient getInstance(){

        if(instance==null){
            synchronized (AlipayConfig.class){
                if(instance == null){
                    instance = new DefaultAlipayClient(PAY_GATEWAY,APPID,APP_PRI_KEY,FORMAT,CHARSET,ALIPAY_PUB_KEY,SIGN_TYPE);
                }
            }
        }
        return instance;
    }
}
